package de.hauschild.gmltracer.gml.impl;

import de.hauschild.gmltracer.gml.Environment;
import de.hauschild.gmltracer.gml.Token;
import de.hauschild.gmltracer.gml.TokenStack;

/**
 * The abstract implementation of {@link Token} providing basic functionality.
 * {@link Token#evaluate(Environment, TokenStack)} will push it self to the {@link TokenStack}.
 * 
 * @author Klaus Hauschild
 * @since 1.0.0
 */
public abstract class AbstractToken implements Token {

  /**
   * {@inheritDoc}
   */
  @Override
  public Token cloneToken() {
    return this;
  }

  @Override
  public void evaluate(final Environment environment, final TokenStack tokenStack) {
    tokenStack.push(this);
  }

}
